package yxk.form.kd.wtc.wtpm.supsignpc;/*
 *
 *@author lqh
 *@date 2023/9/13
 *
 */

import kd.bos.bill.AbstractBillPlugIn;
import kd.bos.dataentity.entity.DynamicObject;
import kd.bos.dataentity.entity.DynamicObjectCollection;
import kd.bos.entity.datamodel.events.PropertyChangedArgs;
import kd.bos.form.container.Container;
import kd.bos.form.control.Control;
import kd.bos.form.control.Label;
import kd.bos.form.control.events.ItemClickEvent;
import kd.bos.servicehelper.operation.SaveServiceHelper;
import kd.bos.util.StringUtils;
import kd.wtc.wtpm.formplugin.suppleapply.SupSignOtherEdit;
import kd.wtc.wtpm.formplugin.suppleapply.helper.SupSignViewHelper;

import java.util.Arrays;
import java.util.EventObject;

/**
 * 审批时显示剩余补卡次数
 *
 * @author root
 * @date 2023/09/14
 */
public class SupSignPCFormPlugin extends SupSignOtherEdit {

    public void afterBindData(EventObject eventObject) {
        super.afterBindData(eventObject);
        Object personDy = this.getView().getModel().getValue("personid");
        this.getView().setVisible(Boolean.FALSE, new String[]{"supsigncountpanel"});
        SupSignViewHelper.showMultipleCountLimit(this.getView());

    }

    /*@Override
    public void propertyChanged(PropertyChangedArgs e) {
        super.propertyChanged(e);
        String name = e.getProperty().getName();
        System.out.printf(name);
        if ("attfilebasef7".equals(name)) {
            DynamicObject attfilebasef7 = (DynamicObject) this.getModel().getValue("attfilebasef7");
            Object pkValue = attfilebasef7.getPkValue();
            System.out.println();
        }
    }*/

    @Override
    public void itemClick(ItemClickEvent evt) {
        super.itemClick(evt);
        String itemKey = evt.getItemKey();
        if ("bar_save".equals(itemKey) || "bar_submit".equals(itemKey) || "bar_submiteffect".equals(itemKey)) {
            //this.getView().updateView("supsigncountpanel");
            //                                                                      9月可补签次数：3次，已申请：2次，剩余：1次；已超额：0次。
            this.getView().setVisible(true, "supsigncountpanel", "countexplain", "sumstr");
            Label countexPlain = this.getView().getControl("countexplain");
            Label sumstr = this.getView().getControl("sumstr");
            System.out.println("111");
        }
    }
}
